package com.example.apidemo.text;

import com.example.apidemo.util.JwtUtils;
import io.jsonwebtoken.Claims;
import io.jsonwebtoken.Jwts;
import io.jsonwebtoken.SignatureAlgorithm;

import java.util.Date;
import java.util.HashMap;
import java.util.Map;

public class JwtExample {


    ///测试方法
    public static void main(String[] args) {

        Map<String, Object> umap = new HashMap<>();
        umap.put("name", "张三");
        umap.put("tel", "123456789");

        String token = JwtUtils.generateJwt(umap);

        System.out.println("Signed Token: " + token);

        Claims claims = JwtUtils.parseJWT(token); // 解析 JWT
        System.out.println("Parsed Claims: " + claims);
    }
}